import {HashRouter,Link} from 'react-router-dom'
import RouterView from "./router5.0/index";
import routes from './router5.0/routes'
function App() {
    return (
        <HashRouter>
          <div>
              <Link to='/a'>Dom1</Link>
              <Link to='/b'>Dom2</Link>
              <Link to='/c'>Dom3</Link>
          </div>
           <div>
               {/*<Switch>*/}
               {/*    /!*重定向*!/*/}
               {/*    <Redirect exact from='/' to="/a" />*/}

               {/*    <Route  path='/a' component={Dom1}></Route>*/}
               {/*    <Route path='/b' component={Dom2}></Route>*/}
               {/*    <Route path='/c' component={Dom3}></Route>*/}

               {/*    /!*404*!/*/}
               {/*    <Redirect to="/a" />*/}
               {/*</Switch>*/}
               <RouterView routes={routes}></RouterView>



           </div>
        </HashRouter>
    );
}


/*
* 二级路由
* */

// <div>
//     <Link to="/a/a1">A1</Link>
//     <Link to="/a/a2">A2</Link>
//     <Link to="/a/a3">A3</Link>
// </div>
// <div>
//     <Switch>
//         <Redirect exact from="/a" to="/a/a1" />
//         <Route path="/a/a1" component={A1} />
//         <Route path="/a/a2" component={A2} />
//         <Route path="/a/a3" component={A3} />
//     </Switch>
// </div>
export default App;
